<!-- Begin: cppage - Proposals -->
<?
if ($_GET['category'] == 'produtos') {
    $category = 'P';
    $name = 'produtos';
} else if ($_GET['category'] == 'veiculos') {
    $category = 'V';
    $name = 'veículos';
}
?>
<div class="cppage proposals">
    <div class="header">
        <h2>Propostas de Produtos</h2>
    </div>
    <div class="message"></div>
    <? if($category=='V'){ ?>
    <div class="table">
        <div class="thead">
            <ul>
                <li style="width: 110px">Data</li>
                <li>Veículo</li>
            </ul>
        </div>
        <? if (CPanel::$proposals == null): ?>
            <div class="empty odd">Nenhum registro foi encontrado</div>
        <? else: ?>
            <div class="tbody">
                <? foreach (CPanel::$proposals as $key => $proposal): ?>
                    <ul class="<? if (!$proposal->read) echo 'new'; elseif (($key + 1) % 2 != 0) echo 'odd' ?>" data="<?= $proposal->p_id ?>">
                        <li><?= date('d/m/Y H:i', strtotime($proposal->date)) ?></li>
                        <li><?= $proposal->m_name . ' ' . $proposal->c_name . ' ' . $proposal->firstreg ?></li>
                    </ul>
                <? endforeach ?>
            </div>
        <? endif ?>
    </div>
    <? }else if($category=='P'){ ?>
    
    <div class="table">
        <div class="thead">
            <ul>
                <li style="width: 110px">Data</li>
                <li>Produto</li>
            </ul>
        </div>
        <? if (CPanel::$proposals_products == null): ?>
            <div class="empty odd">Nenhum registro foi encontrado</div>
        <? else: ?>
            <div class="tbody">
                <? foreach (CPanel::$proposals_products as $key => $proposal): ?>
                <ul class="<? if (!$proposal->read) echo 'new'; elseif (($key + 1) % 2 != 0) echo 'odd' ?>" data="<?= $proposal->p_id ?>" id="<?= $proposal->p_id ?>">
                        <li><?= date('d/m/Y H:i', strtotime($proposal->date)) ?></li>
                        <li><?= $proposal->pp_name ?></li>
                    </ul>
                <? endforeach ?>
            </div>
        <? endif ?>
    </div>
    <? } ?>
</div> <!-- End -->
